package main

import (
	"fmt"
	"time"
)

func main() {
	ch := make(chan int, 5)
	go func() {
		ch <- 1
		ch <- 2
	}()

	go func() {
		for {
			data := <-ch
			time.Sleep(1 * time.Second)
			fmt.Println(11111, data)
		}

	}()

	for i := 0; i < 5; i++ {
		ch <- 6
		fmt.Println(222222)
	}

	time.Sleep(10 * time.Second)
}
